<template>
  <div class="father">
      <h3>父组件</h3>
      <h4>父的礼物:{{ gift }}</h4>
      <h4 v-show="toy">子给的礼物:{{ toy }}</h4>
      <Hello :gift="gift" :sendToy="getToy"/>
  </div>
</template>

<script setup lang="ts" name="Father">
  import Hello from "./Hello.vue"
  import {ref} from "vue"
  let gift=ref("car")
  let toy=ref()
  function getToy(value:string){
    toy.value=value
  }

</script>



<style scoped>
 .father{
  background-color: bisque;
  padding: 20px;
  border-radius: 10px;
 }
</style>



